const path = require('path');
const copyWebpackPlugin = require('copy-webpack-plugin');
console.log(path.resolve(__dirname, "dist"))
module.exports = {
	entry:'./server.js',
	mode: 'production',
	target:"node",
	output:{
		path: path.resolve(__dirname, "dist_server"),
		filename:'index.js',
		publicPath: path.resolve(__dirname, "public")
	},
	node: {
		__filename: true,
		__dirname: false
	},
	externals: [
    ],
	module: {
    },
	plugins:[
		new copyWebpackPlugin([{
			from: path.resolve(__dirname, "dist"),
			to:path.resolve(__dirname, "dist_server/dist")
		}])
	],
	resolve:{
		modules:["node_modules"]
	}
}